use "build/output/main_panel.dta", clear
tsset coin_id date

tempfile tf1
binscatter margin_aprFTX e_rBTC_2m_annualized if coin == "USDT", nq(50) savedata(`tf1') replace
import delimited `tf1'.csv, clear

tw (scatter margin_apr e_rbtc_2m_annualized) ///
   (lfit margin_apr e_rbtc_2m_annualized, lcolor(gs12)), xtitle("Bitcoin E[R], (%, Annualized)") ytitle("") subtitle("USDT Margin Lending Rate (%, Annualized)",  orientation(horizontal)  bexpand justification(left)) legend(off) scale(*1.25)
   
gr export "analysis/output_figures/scatter_stablecoinRates_vs_er.pdf", replace
